#include "WPILib.h"


class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; 
	Joystick stick; 
	AnalogChannel backEMF;

	int LSBWeight;
	int offset;
	float voltage;
	
public:
	RobotDemo(void):
		myRobot(1, 2),	// these must be initialized in the same order
		stick(1),		// as they are declared above.
		backEMF(1)
	{
		myRobot.SetExpiration(0.1);
		LSBWeight = 0;
		offset = 0;
		voltage = 0.0;
	}

	void getVals()
	{
		LSBWeight = backEMF.GetLSBWeight();
		offset = backEMF.GetOffset();
		voltage = backEMF.GetVoltage();
	}
	void showVals()
	{
		printf("\nThe LSB Weight of the channel is: %d", LSBWeight);
		printf("\nThe offset of the channel is: %d", offset);
		printf("\nThe voltage of the channel is: %f", voltage);
	}
	
	void Autonomous(void)
	{
	}

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		myRobot.SetSafetyEnabled(false);
		while (IsOperatorControl())
		{
			getVals();
			showVals();
		}
	}

	void Test() {

	}
	
};

START_ROBOT_CLASS(RobotDemo);

